package com.atguigu.spring5.factory;

import com.atguigu.spring5.dao.UserDao;

/**
 * @author : wenchao.long
 * @date : Created in 2020/10/29 10:30 周四
 * @description :
 */
public class UserFactory {

    public static UserDao getDao() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        // 1. 解析xml文件 获取全路径
        String value = "com.atguigu.spring5.dto.UserDao";
        Class<?> aClass = Class.forName(value);
        return (UserDao) aClass.newInstance();
    }
}
